package com.dayfly.tip.dao.impl;

import java.util.HashMap;
import java.util.Map;

import com.dayfly.tip.dao.BaseDAO;
import com.dayfly.tip.dao.WeiboDAO;
import com.dayfly.tip.model.WeiboToken;

public class WeiboDAOImpl extends BaseDAO implements WeiboDAO {

	@Override
	public boolean saveWeiboToken(WeiboToken token) {
		this.getSqlMapClientTemplate().insert("insertToken", token);
		return true;
	}

	@Override
	public WeiboToken getWeiboTokenByUserId(long userId, int type) {
		Map<String,Object> paramMap = new HashMap<String, Object>();
		paramMap.put("userId", userId);
		paramMap.put("type", type);
		return (WeiboToken) this.getSqlMapClientTemplate().queryForObject("getTokenByUserId",paramMap);
	}
}
